package com.lianjia.crawler.model;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.Map;

/**
 * 房屋信息模型类，用于存储爬取的房屋信息
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HouseInfo {
    private String title;       // 标题
    private String location;    // 位置
    private Map<String, String> details;  // 详细信息（户型、面积、朝向等）
    private Price price;        // 价格信息
    private String image;       // 图片URL或本地路径
    private String link;        // 详情链接

    /**
     * 价格信息内部类
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Price {
        private String totalPrice;  // 总价
        private String unitPrice;   // 单价

        public String getTotalPrice() {
            return totalPrice;
        }

        public void setTotalPrice(String totalPrice) {
            this.totalPrice = totalPrice;
        }

        public String getUnitPrice() {
            return unitPrice;
        }

        public void setUnitPrice(String unitPrice) {
            this.unitPrice = unitPrice;
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Map<String, String> getDetails() {
        return details;
    }

    public void setDetails(Map<String, String> details) {
        this.details = details;
    }

    public Price getPrice() {
        return price;
    }

    public void setPrice(Price price) {
        this.price = price;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }
} 